import { defineStore } from 'pinia'
// 有关http的store
const useHttpStore = defineStore('http', {
  state: () => ({

   //正在等待的请求数量
   pendingNum:0,
   requestSum:0,
  }),
  actions:{
    //添加等待请求
    addPendingNum(){
      this.pendingNum++
    },
    //删除等待请求
    deletePendingNum(){
      this.pendingNum--
    },
    //获取等待请求数量
    getPendingNum(){
      return this.pendingNum
    },
    //获取请求数量
    getRequestSum(){
      return this.requestSum
    },
    //添加请求
    addRequestSum(){
      this.requestSum++
    }
  }
})

export default useHttpStore